//
//  RLFMDBModel.h
//  CodeFor链式编程
//
//  Created by relax on 2017/11/16.
//  Copyright © 2017年 relax. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RLFMDBMaker.h" // SQL 语句构造器

@interface RLFMDBModel : NSObject


/**
 创建SQLITE文件

 @param DBpath 文件路径
 @param DBFileName 文件名
 @return 返回对象
 */
- (instancetype)initWithDBPath:(NSString *)DBpath DBfileName:(NSString *)DBFileName;


/**
 创建数据表

 @param name 表名
 @param maker 创建表的具体语句
 */
- (void)createTableName:(NSString *)name maker:(void(^)(RLFMDBMaker *))maker;


/**
 插入数据

 @param tableName 需要插入数据的表
 @param maker 插入语句构造器
 */
- (void)insertIntoTableName:(NSString *)tableName maker:(void(^)(RLFMDBMaker *))maker;


/**
 查询表格

 @param tableName 表名
 @param maker 查询语句构造器
 @param resultBlock 返回查询结果回调
 */
- (void)selectFromTableName:(NSString *)tableName maker:(void(^)(RLFMDBMaker *))maker result:(FMResultBlock)resultBlock;


/**
 删除

 @param tableName 表名
 @param maker 删除语句构造器
 */
- (void)deleteFromTableName:(NSString *)tableName maker:(void(^)(RLFMDBMaker *))maker;

/// 修改
- (void)updateFromTableName:(NSString *)tableName maker:(void(^)(RLFMDBMaker *))maker;

@end
